var myApp = sy.getModule('myApp',[]);
myApp.controller('setController', function($scope,$http) {
	$scope.hasLogin = false;
    sy.openLoad();
	$http.post(sy.path + "/m/home/userInfo", {}).success(function(data) {
		if(data.code == 0){
			$scope.hasLogin = true;
		}
		sy.closeLoad();
	}).error(function(data, status) {
		sy.closeLoad();
	});
  
	$scope.logout = function(){
		if(!$scope.hasLogin){
			return;
		}else{
		    sy.openLoad();
			$http.post(sy.path + "/m/login/logout", {}).success(function(data) {
				$scope.hasLogin = true;
				sy.closeLoad();
			}).error(function(data, status) {
				sy.closeLoad();
			});
		}
	};
	
	$scope.about = function(){
		location.href='/m/xiaofei';
	};
	$scope.feedback = function(){
		location.href='/m/xiaofei';
	};
});
